package cn.springcloudtest.service.impl;

import cn.springcloudtest.client.LogClient;
import cn.springcloudtest.common.Dto;
import cn.springcloudtest.common.DtoUtil;
import cn.springcloudtest.pojo.Log;
import cn.springcloudtest.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * @ProjectName:springcloud-topic-consumer
 * @Author:赵伟杰
 * @Date:2021年09月06日 8:41
 */
@Service
public class LogServiceImpl implements LogService {

    @Resource
    private LogClient logClient;

    @Override
    public Dto<List<Log>> getLogList() {
        try {
            HashMap hashMap=new HashMap();
            return DtoUtil.returnSuccess("查询成功", logClient.getLogListByMap(hashMap));
        } catch (Exception e) {
            e.printStackTrace();
            return DtoUtil.returnFail("数据异常", "10000");
        }
    }
}
